core: Remove old wrapper functions in import path
authorColin Walters <walters@verbum.org>
Wed, 9 Nov 2011 00:23:04 +0000 (19:23 -0500)
committerColin Walters <walters@verbum.org>
Wed, 9 Nov 2011 00:23:04 +0000 (19:23 -0500)
Just code cleanup.

libostree/ostree-repo.c
libostree/ostree-repo.h

index 1a03bf7581044f8aed3443111c956320ee571b6c..9e071115024e6003bf071cfe88793991e15afe8c 100644 (file)
 #include <gio/gunixoutputstream.h>
 #include <gio/gunixinputstream.h>
 
-static gboolean
-link_one_file (OstreeRepo *self, const char *path,
-               OstreeObjectType type,
-               gboolean ignore_exists, gboolean force,
-               GChecksum **out_checksum,
-               GError **error);
 static char *
 get_object_path (OstreeRepo  *self,
                  const char    *checksum,
@@ -932,53 +926,6 @@ ostree_repo_store_object_trusted (OstreeRepo   *self,
     return link_object_trusted (self, path, checksum, objtype, ignore_exists, force, did_exist, error);
 }
 
-static gboolean
-link_one_file (OstreeRepo *self, const char *path, OstreeObjectType type,
-               gboolean ignore_exists, gboolean force,
-               GChecksum **out_checksum,
-               GError **error)
-{
-  gboolean ret = FALSE;
-  struct stat stbuf;
-  GChecksum *id = NULL;
-  gboolean did_exist;
-
-  if (!ostree_stat_and_checksum_file (-1, path, type, &id, &stbuf, error))
-    goto out;
-
-  if (!ostree_repo_store_object_trusted (self, path, g_checksum_get_string (id), type,
-                                         ignore_exists, force, &did_exist, error))
-    goto out;
-
-  *out_checksum = id;
-  id = NULL;
-  ret = TRUE;
- out:
-  if (id != NULL)
-    g_checksum_free (id);
-  return ret;
-}
-
-gboolean
-ostree_repo_link_file (OstreeRepo *self,
-                       const char   *path,
-                       gboolean      ignore_exists,
-                       gboolean      force,
-                       GError      **error)
-{
-  OstreeRepoPrivate *priv = GET_PRIVATE (self);
-  GChecksum *checksum = NULL;
-
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-  g_return_val_if_fail (priv->inited, FALSE);
-
-  if (!link_one_file (self, path, OSTREE_OBJECT_TYPE_FILE,
-                      ignore_exists, force, &checksum, error))
-    return FALSE;
-  g_checksum_free (checksum);
-  return TRUE;
-}
-
 gboolean
 ostree_repo_store_packfile (OstreeRepo       *self,
                             const char       *expected_checksum,
@@ -1509,12 +1456,17 @@ add_one_file_to_tree_and_import (OstreeRepo   *self,
 {
   gboolean ret = FALSE;
   GChecksum *checksum = NULL;
+  struct stat stbuf;
+  gboolean did_exist;
   
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
   g_assert (tree != NULL);
 
-  if (!link_one_file (self, abspath, OSTREE_OBJECT_TYPE_FILE,
-                      TRUE, FALSE, &checksum, error))
+  if (!ostree_stat_and_checksum_file (-1, abspath, OSTREE_OBJECT_TYPE_FILE, &checksum, &stbuf, error))
+    goto out;
+
+  if (!ostree_repo_store_object_trusted (self, abspath, g_checksum_get_string (checksum),
+                                         OSTREE_OBJECT_TYPE_FILE, TRUE, FALSE, &did_exist, error))
     goto out;
 
   g_hash_table_replace (tree->files, g_strdup (basename),
index e9a690a051bf5d564d1705ae50fcb280f5403442..b7a259c2bf981fae53ff5b728b558d5db229a4ef 100644 (file)
@@ -65,12 +65,6 @@ gboolean      ostree_repo_write_config (OstreeRepo *self,
                                         GKeyFile   *new_config,
                                         GError    **error);
 
-gboolean      ostree_repo_link_file (OstreeRepo *self,
-                                     const char   *path,
-                                     gboolean      ignore_exists,
-                                     gboolean      force,
-                                     GError      **error);
-
 gboolean      ostree_repo_store_packfile (OstreeRepo       *self,
                                            const char       *expected_checksum,
                                            const char       *path,